package pers.vic.widget.util;

/**
 * @author Vic.xu
 * @description:
 * @date: 2021/8/26 0026 18:01
 */
public class JdbcTemplateUtil {

    /*
    HikariConfig config = new HikariConfig();
            config.setDriverClassName("com.mysql.jdbc.Driver");
            config.setJdbcUrl(a.getServerAddr());
            config.setUsername(a.getDbAccount());
            config.setPassword(a.getDbPwd());
            config.addDataSourceProperty("cachePrepStmts", "true");
            config.addDataSourceProperty("prepStmtCacheSize", "1000");
            config.addDataSourceProperty("prepStmtCacheSqlLimit", "3000");
            try {
                HikariDataSource dataSource = new HikariDataSource(config);
                JdbcTemplate jdbc = new JdbcTemplate(dataSource);
                String datasourceKey = StringUtil.generateDataSourceKey(a.getServerAddr(), a.getDbAccount(), a.getDbPwd());
                jdbcCache.put(datasourceKey, jdbc);
            } catch (Exception e) {
                //TODO: 存在部分数据库无法连接的情况
                log.error("出问题的连接：{}", a.getServerAddr());
            }
     */

    public static void main(String[] args) {

    }
}
